// src/router/index.js
import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../pages/HomePage.vue";

import UserManger from "../pages/UserMangerPage.vue";
import LoginPage from "../pages/LoginPage.vue";
import MenumangerPage from "../pages/MenuMangerPage";

import UserItem from "../pages/UserItemPage.vue";

import RoleManger from "../pages/RoleMangerPage.vue";
import RoleItem from "../pages/RoleItemPage.vue";
import StatisticsPage from "../pages/StatisticsPage.vue";
import GuidePage from "../pages/GuidePage.vue";
import ClientItemPage from "../pages/ClientItemPage.vue";
import ClientMangerPage from "../pages/ClientMangerPage.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/Home",
    name: "Home",
    component: Home,
    children: [
      {
        path: "UserManger",
        name: "UserManger",
        component: UserManger,
      },
      {
        path: "UserItem/:id/:type",
        name: "UserItem",
        component: UserItem,
      },
      {
        path: "RoleManger",
        name: "RoleManger",
        component: RoleManger,
      },
      {
        path: "RoleItem/:id/:type",
        name: "RoleItem",
        component: RoleItem,
      },
      {
        path: "ClientManger",
        name: "ClientManger",
        component: ClientMangerPage,
      },
      {
        path: "ClientItem/:id/:type",
        name: "ClientItem",
        component: ClientItemPage,
      },
      {
        path: "MenumangerPage",
        name: "MenumangerPage",
        component: MenumangerPage,
      },
      {
        path: "StatisticsPage",
        name: "StatisticsPage",
        component: StatisticsPage,
      },
    ],
  },

  {
    path: "/",
    name: "LoginPage",
    component: LoginPage,
  },
  {
    path: "",
    name: "LoginPage",
    component: LoginPage,
  },
  {
    path: "/GuidePage",
    name: "GuidePage",
    component: GuidePage,
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
